X-Git-Url: https://git.r.bdr.sh/rbdr/super-polarity/blobdiff_plain/8534e46e400268c5ceffb3b14f02cef39eedae8f..3de51c6f55d304f038df1b77c8ab346e2a187fe1:/Super%20Polarity/TitleScreen.cs diff --git a/Super Polarity/TitleScreen.cs b/Super Polarity/TitleScreen.cs new file mode 100644 index 0000000..a953f27 --- /dev/null +++ b/Super Polarity/TitleScreen.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace SuperPolarity +{ + class TitleScreen : Screen + { + protected Texture2D TitleImage; + + public TitleScreen(SuperPolarity newGame) : base(newGame) {} + + public override void LoadContent() + { + base.LoadContent(); + TitleImage = Game.Content.Load("Graphics\\polaritydemotitle"); + InputController.Bind("pause", HandleStart); + } + + public void HandleStart(float value) + { + if (!Active) { return; } + Game.Player.Reset(); + var gameScreen = new GameScreen(Game); + gameScreen.Initialize(); + ScreenManager.Push(gameScreen); + } + + public override void CleanUp() + { + base.CleanUp(); + TitleImage = null; + } + + public override void Draw(SpriteBatch spriteBatch) + { + base.Draw(spriteBatch); + spriteBatch.Draw(TitleImage, new Vector2(0, 0), Color.White); + } + + public override void Update(GameTime gameTime) + { + base.Update(gameTime); + InputController.UpdateInput(false); + } + } +}